package com.inossem.warehousestorage_inossem.request.allocation;

import android.content.Context;

import com.google.gson.Gson;
import com.inossem.warehousestorage_inossem.bean.allocation.AllocationOutStorageBaseInfoBean;
import com.inossem.warehousestorage_inossem.constant.RequestConstant;
import com.inossem.warehousestorage_inossem.listener.GsonBeanListener;
import com.inossem.warehousestorage_inossem.listener.StringRequestListener;
import com.inossem.warehousestorage_inossem.manage.RequestManage;
import com.inossem.warehousestorage_inossem.model.StringResponse;
import com.inossem.warehousestorage_inossem.request.Request;

/**
 * 调拨出库基础信息
 *
 * @author 詹建宇
 * @time on 2018/3/29 10:01
 * @email jianyu.zhan@inossem.com
 */
public class AllocationOutStorageBaseInfoRequest extends Request {

    public static String request(Context context, GsonBeanListener gsonBeanListener) {
        String tag;
        String url = RequestManage.getUrl(context, RequestConstant.URL_ALLOCATION_OUT_CREAT_DOCUMENT);
        tag = RequestManage.getHttpsGetWithLoading(context, url, new StringRequestListener() {
            @Override
            public void onSuccess(StringResponse stringRequestResponse) {
                Gson gson = new Gson();
                AllocationOutStorageBaseInfoBean bean = gson.fromJson(stringRequestResponse.getResponseInfo(), AllocationOutStorageBaseInfoBean.class);
                excuteJsonBeanNew(context, bean, gsonBeanListener);
            }
        });
        return tag;
    }

}
